{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "ccabbfe4",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sympy import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "c5601301",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sympy.abc import x,y,z,a,b,c,m,n,k"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "272739db",
   "metadata": {},
   "outputs": [],
   "source": [
    "f=Function(\"f\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "ba630082",
   "metadata": {},
   "outputs": [],
   "source": [
    "g=Function(\"g\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "a7a33a8f",
   "metadata": {},
   "outputs": [],
   "source": [
    "a=symbols(\"a\",reals=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "3d875e5a",
   "metadata": {},
   "outputs": [],
   "source": [
    "f=a**x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "f76b9e19",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle a^{x}$"
      ],
      "text/plain": [
       "a**x"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "183a910f",
   "metadata": {},
   "outputs": [],
   "source": [
    "g=log(x,a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "6267d24c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{\\log{\\left(x \\right)}}{\\log{\\left(a \\right)}}$"
      ],
      "text/plain": [
       "log(x)/log(a)"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "g"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "ad5247f8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left\\{\\left( x, \\  a\\right)\\; \\middle|\\; \\left( x, \\  a\\right) \\in \\mathbb{C}^{2} \\wedge a^{x} \\log{\\left(a \\right)} - \\log{\\left(x \\right)} = 0 \\wedge a^{x} x \\log{\\left(a \\right)}^{2} - 1 = 0 \\right\\}$"
      ],
      "text/plain": [
       "ConditionSet((x, a), Eq(a**x*log(a) - log(x), 0) & Eq(a**x*x*log(a)**2 - 1, 0), ProductSet(Complexes, Complexes))"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "nonlinsolve([Eq(diff(f,x),diff(g,x)),Eq(f,g)],[x,a],Reals)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3158f032",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
